import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from "typeorm";
import { ManualTimestamp } from "../decorators/manual-timestamp.decorator";

@Entity("gem_attributes")
@ManualTimestamp()
export class GemAttributeEntity {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column("int", { name: "gem_id", comment: "宝石ID" })
  gemId!: number;

  @Column("varchar", {
    length: 50,
    name: "attribute_name",
    comment: "属性名称",
  })
  attributeName!: string;

  @Column("varchar", {
    length: 10,
    name: "short_name",
    nullable: true,
    comment: "属性简称",
  })
  shortName!: string;

  @Column("varchar", {
    length: 50,
    name: "equipment_slots",
    comment: "可镶嵌装备槽位，1头盔 2武器 3铠甲 4项链 5护腕 6鞋子",
  })
  equipmentSlots!: string;

  @Column("int", { name: "max_value", comment: "最大属性值" })
  maxValue!: number;

  @Column("datetime", { name: "created_at", comment: "创建时间" })
  created_at!: Date;

  @Column("datetime", {
    name: "updated_at",
    nullable: true,
    comment: "更新时间",
  })
  updated_at!: Date | null;

  // 关联关系
}
